
import { createRouter, createWebHistory } from 'vue-router'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/login',
      name: 'login',
      component:()=>import('@/views/LoginView.vue')
    },
    {
      path: '/',
      name: 'layout',
      component:() => import('@/views/LayoutView.vue'),
      children:[
        { path: '', component:()=>import('@/views/HomeView.vue') },
        { path: 'profile', component:()=>import('@/views/ProfileView.vue') },
        { path: 'article/:target?', component: ()=>import('@/views/ArticleView.vue') },
        { path: 'publish/:id?', component: ()=>import('@/views/PublishView.vue') }
      ]
    }

  ],
})

export default router
